package com.conversationboard.filedownload;

import java.util.Collection;

import eu.medsea.mimeutil.MimeType;
import eu.medsea.mimeutil.MimeUtil;

public class MimeTypes {

	static {
		MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.ExtensionMimeDetector");
	}


	public static String get(String fileName) throws MimeTypeException {

		Collection mimeTypes = MimeUtil.getMimeTypes(fileName);

		MimeType mimeType = (MimeType) mimeTypes.toArray()[0];

		return mimeType.toString();

	}

}
